Load Data

dataset <- read.delim("raw_data/FigureS1F.txt", stringsAsFactors = FALSE)

dataset$genotype <-  factor(dataset$genotype, levels = unique(dataset$genotype))
dataset$Experiment <- factor(rep(paste0("exp", 1:(length(dataset$genotype)/length(levels(dataset$genotype)))), each=length(levels(dataset$genotype))))

# genotype+Experiment gives unique ID (UID)
dataset$UID <- factor(paste(dataset$Experiment, dataset$genotype))


# wide format
kable(dataset, row.names = F)
genotype NT veliparib_30nM veliparib_300nM veliparib_3000nM Experiment UID
WT 875.0 978.5 930.0 875.5 exp1 exp1 WT
PARP1KO 763.0 804.0 723.5 749.0 exp1 exp1 PARP1KO
ALC1KO 726.0 680.5 478.0 173.5 exp1 exp1 ALC1KO
ALC1KO PARP1KO 458.5 571.0 507.5 515.5 exp1 exp1 ALC1KO PARP1KO
WT 632.0 682.0 650.0 720.5 exp2 exp2 WT
PARP1KO 892.0 916.0 856.0 896.0 exp2 exp2 PARP1KO
ALC1KO 982.0 1009.0 1000.5 797.5 exp2 exp2 ALC1KO
ALC1KO PARP1KO 720.0 775.5 707.0 753.0 exp2 exp2 ALC1KO PARP1KO
WT 645.5 682.5 600.0 736.5 exp3 exp3 WT
PARP1KO 923.0 913.0 879.5 901.0 exp3 exp3 PARP1KO
ALC1KO 963.0 1062.5 959.0 801.0 exp3 exp3 ALC1KO
ALC1KO PARP1KO 744.0 710.5 733.5 766.0 exp3 exp3 ALC1KO PARP1KO
WT 953.0 967.0 950.5 977.5 exp4 exp4 WT
PARP1KO 783.0 895.5 905.5 884.0 exp4 exp4 PARP1KO
ALC1KO 850.0 797.0 677.0 269.5 exp4 exp4 ALC1KO
ALC1KO PARP1KO 950.0 960.5 983.5 930.0 exp4 exp4 ALC1KO PARP1KO
WT 789.5 788.5 709.0 748.5 exp5 exp5 WT
PARP1KO 802.5 799.0 795.0 856.0 exp5 exp5 PARP1KO
ALC1KO 927.0 688.5 493.0 226.5 exp5 exp5 ALC1KO
ALC1KO PARP1KO 969.5 969.5 932.5 881.0 exp5 exp5 ALC1KO PARP1KO
library(reshape2)
# reshape to long format
dataset <- melt(dataset, variable.name = "Treatment", value.name = "Counts")

dataset$genotype <- relevel(dataset$genotype, ref = "WT")
dataset$UID <- relevel(dataset$UID, ref = "exp1 WT")

dataset$Veliparib <- gsub("NT","1",dataset$Treatment)
dataset$Veliparib <- gsub("veliparib_|nM","",dataset$Veliparib)
dataset$Veliparib <- log10(as.integer(dataset$Veliparib))


dataset$Offset <- NA
for(uid in levels(dataset$UID)){
        dataset$Offset[dataset$UID == uid] <- mean(dataset$Counts[dataset$UID == uid])
}

dataset$NormCounts <- dataset$Counts / dataset$Offset



dataset$Offset2 <- NA
for(gidx in levels(dataset$genotype)){
        dataset$Offset2[dataset$genotype == gidx] <- mean(dataset$NormCounts[dataset$genotype == gidx & dataset$Veliparib == 0])
}

dataset$NormCounts2 <- dataset$NormCounts / dataset$Offset2



# long format
kable(dataset, row.names = F)
genotype Experiment UID Treatment Counts Veliparib Offset NormCounts Offset2 NormCounts2
WT exp1 exp1 WT NT 875.0 0.000000 914.750 0.9565455 0.9796571 0.9764085
PARP1KO exp1 exp1 PARP1KO NT 763.0 0.000000 759.875 1.0041125 0.9834567 1.0210033
ALC1KO exp1 exp1 ALC1KO NT 726.0 0.000000 514.500 1.4110787 1.2728618 1.1085875
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO NT 458.5 0.000000 513.125 0.8935445 0.9805229 0.9112938
WT exp2 exp2 WT NT 632.0 0.000000 671.125 0.9417024 0.9796571 0.9612571
PARP1KO exp2 exp2 PARP1KO NT 892.0 0.000000 890.000 1.0022472 0.9834567 1.0191066
ALC1KO exp2 exp2 ALC1KO NT 982.0 0.000000 947.250 1.0366851 1.2728618 0.8144522
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO NT 720.0 0.000000 738.875 0.9744544 0.9805229 0.9938109
WT exp3 exp3 WT NT 645.5 0.000000 666.125 0.9690373 0.9796571 0.9891597
PARP1KO exp3 exp3 PARP1KO NT 923.0 0.000000 904.125 1.0208765 0.9834567 1.0380493
ALC1KO exp3 exp3 ALC1KO NT 963.0 0.000000 946.375 1.0175670 1.2728618 0.7994324
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO NT 744.0 0.000000 738.500 1.0074475 0.9805229 1.0274594
WT exp4 exp4 WT NT 953.0 0.000000 962.000 0.9906445 0.9796571 1.0112155
PARP1KO exp4 exp4 PARP1KO NT 783.0 0.000000 867.000 0.9031142 0.9834567 0.9183060
ALC1KO exp4 exp4 ALC1KO NT 850.0 0.000000 648.375 1.3109697 1.2728618 1.0299388
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO NT 950.0 0.000000 956.000 0.9937238 0.9805229 1.0134631
WT exp5 exp5 WT NT 789.5 0.000000 758.875 1.0403558 0.9796571 1.0619591
PARP1KO exp5 exp5 PARP1KO NT 802.5 0.000000 813.125 0.9869331 0.9834567 1.0035349
ALC1KO exp5 exp5 ALC1KO NT 927.0 0.000000 583.750 1.5880086 1.2728618 1.2475891
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO NT 969.5 0.000000 938.125 1.0334444 0.9805229 1.0539727
WT exp1 exp1 WT veliparib_30nM 978.5 1.477121 914.750 1.0696912 0.9796571 1.0919037
PARP1KO exp1 exp1 PARP1KO veliparib_30nM 804.0 1.477121 759.875 1.0580688 0.9834567 1.0758671
ALC1KO exp1 exp1 ALC1KO veliparib_30nM 680.5 1.477121 514.500 1.3226433 1.2728618 1.0391099
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO veliparib_30nM 571.0 1.477121 513.125 1.1127893 0.9805229 1.1348937
WT exp2 exp2 WT veliparib_30nM 682.0 1.477121 671.125 1.0162041 0.9796571 1.0373059
PARP1KO exp2 exp2 PARP1KO veliparib_30nM 916.0 1.477121 890.000 1.0292135 0.9834567 1.0465265
ALC1KO exp2 exp2 ALC1KO veliparib_30nM 1009.0 1.477121 947.250 1.0651887 1.2728618 0.8368455
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO veliparib_30nM 775.5 1.477121 738.875 1.0495686 0.9805229 1.0704172
WT exp3 exp3 WT veliparib_30nM 682.5 1.477121 666.125 1.0245825 0.9796571 1.0458583
PARP1KO exp3 exp3 PARP1KO veliparib_30nM 913.0 1.477121 904.125 1.0098161 0.9834567 1.0268028
ALC1KO exp3 exp3 ALC1KO veliparib_30nM 1062.5 1.477121 946.375 1.1227051 1.2728618 0.8820321
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO veliparib_30nM 710.5 1.477121 738.500 0.9620853 0.9805229 0.9811961
WT exp4 exp4 WT veliparib_30nM 967.0 1.477121 962.000 1.0051975 0.9796571 1.0260708
PARP1KO exp4 exp4 PARP1KO veliparib_30nM 895.5 1.477121 867.000 1.0328720 0.9834567 1.0502465
ALC1KO exp4 exp4 ALC1KO veliparib_30nM 797.0 1.477121 648.375 1.2292269 1.2728618 0.9657190
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO veliparib_30nM 960.5 1.477121 956.000 1.0047071 0.9805229 1.0246646
WT exp5 exp5 WT veliparib_30nM 788.5 1.477121 758.875 1.0390380 0.9796571 1.0606140
PARP1KO exp5 exp5 PARP1KO veliparib_30nM 799.0 1.477121 813.125 0.9826287 0.9834567 0.9991581
ALC1KO exp5 exp5 ALC1KO veliparib_30nM 688.5 1.477121 583.750 1.1794433 1.2728618 0.9266074
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO veliparib_30nM 969.5 1.477121 938.125 1.0334444 0.9805229 1.0539727
WT exp1 exp1 WT veliparib_300nM 930.0 2.477121 914.750 1.0166712 0.9796571 1.0377827
PARP1KO exp1 exp1 PARP1KO veliparib_300nM 723.5 2.477121 759.875 0.9521303 0.9834567 0.9681466
ALC1KO exp1 exp1 ALC1KO veliparib_300nM 478.0 2.477121 514.500 0.9290573 1.2728618 0.7298965
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO veliparib_300nM 507.5 2.477121 513.125 0.9890378 0.9805229 1.0086840
WT exp2 exp2 WT veliparib_300nM 650.0 2.477121 671.125 0.9685230 0.9796571 0.9886347
PARP1KO exp2 exp2 PARP1KO veliparib_300nM 856.0 2.477121 890.000 0.9617978 0.9834567 0.9779767
ALC1KO exp2 exp2 ALC1KO veliparib_300nM 1000.5 2.477121 947.250 1.0562154 1.2728618 0.8297958
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO veliparib_300nM 707.0 2.477121 738.875 0.9568601 0.9805229 0.9758671
WT exp3 exp3 WT veliparib_300nM 600.0 2.477121 666.125 0.9007318 0.9796571 0.9194358
PARP1KO exp3 exp3 PARP1KO veliparib_300nM 879.5 2.477121 904.125 0.9727637 0.9834567 0.9891271
ALC1KO exp3 exp3 ALC1KO veliparib_300nM 959.0 2.477121 946.375 1.0133404 1.2728618 0.7961118
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO veliparib_300nM 733.5 2.477121 738.500 0.9932295 0.9805229 1.0129590
WT exp4 exp4 WT veliparib_300nM 950.5 2.477121 962.000 0.9880457 0.9796571 1.0085628
PARP1KO exp4 exp4 PARP1KO veliparib_300nM 905.5 2.477121 867.000 1.0444060 0.9834567 1.0619745
ALC1KO exp4 exp4 ALC1KO veliparib_300nM 677.0 2.477121 648.375 1.0441488 1.2728618 0.8203159
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO veliparib_300nM 983.5 2.477121 956.000 1.0287657 0.9805229 1.0492011
WT exp5 exp5 WT veliparib_300nM 709.0 2.477121 758.875 0.9342777 0.9796571 0.9536783
PARP1KO exp5 exp5 PARP1KO veliparib_300nM 795.0 2.477121 813.125 0.9777095 0.9834567 0.9941561
ALC1KO exp5 exp5 ALC1KO veliparib_300nM 493.0 2.477121 583.750 0.8445396 1.2728618 0.6634967
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO veliparib_300nM 932.5 2.477121 938.125 0.9940040 0.9805229 1.0137489
WT exp1 exp1 WT veliparib_3000nM 875.5 3.477121 914.750 0.9570921 0.9796571 0.9769664
PARP1KO exp1 exp1 PARP1KO veliparib_3000nM 749.0 3.477121 759.875 0.9856884 0.9834567 1.0022693
ALC1KO exp1 exp1 ALC1KO veliparib_3000nM 173.5 3.477121 514.500 0.3372206 1.2728618 0.2649310
ALC1KO PARP1KO exp1 exp1 ALC1KO PARP1KO veliparib_3000nM 515.5 3.477121 513.125 1.0046285 0.9805229 1.0245844
WT exp2 exp2 WT veliparib_3000nM 720.5 3.477121 671.125 1.0735705 0.9796571 1.0958635
PARP1KO exp2 exp2 PARP1KO veliparib_3000nM 896.0 3.477121 890.000 1.0067416 0.9834567 1.0236765
ALC1KO exp2 exp2 ALC1KO veliparib_3000nM 797.5 3.477121 947.250 0.8419108 1.2728618 0.6614314
ALC1KO PARP1KO exp2 exp2 ALC1KO PARP1KO veliparib_3000nM 753.0 3.477121 738.875 1.0191169 0.9805229 1.0393606
WT exp3 exp3 WT veliparib_3000nM 736.5 3.477121 666.125 1.1056483 0.9796571 1.1286075
PARP1KO exp3 exp3 PARP1KO veliparib_3000nM 901.0 3.477121 904.125 0.9965436 0.9834567 1.0133070
ALC1KO exp3 exp3 ALC1KO veliparib_3000nM 801.0 3.477121 946.375 0.8463875 1.2728618 0.6649485
ALC1KO PARP1KO exp3 exp3 ALC1KO PARP1KO veliparib_3000nM 766.0 3.477121 738.500 1.0372376 0.9805229 1.0578413
WT exp4 exp4 WT veliparib_3000nM 977.5 3.477121 962.000 1.0161123 0.9796571 1.0372122
PARP1KO exp4 exp4 PARP1KO veliparib_3000nM 884.0 3.477121 867.000 1.0196078 0.9834567 1.0367592
ALC1KO exp4 exp4 ALC1KO veliparib_3000nM 269.5 3.477121 648.375 0.4156545 1.2728618 0.3265512
ALC1KO PARP1KO exp4 exp4 ALC1KO PARP1KO veliparib_3000nM 930.0 3.477121 956.000 0.9728033 0.9805229 0.9921271
WT exp5 exp5 WT veliparib_3000nM 748.5 3.477121 758.875 0.9863284 0.9796571 1.0068099
PARP1KO exp5 exp5 PARP1KO veliparib_3000nM 856.0 3.477121 813.125 1.0527287 0.9834567 1.0704372
ALC1KO exp5 exp5 ALC1KO veliparib_3000nM 226.5 3.477121 583.750 0.3880086 1.2728618 0.3048316
ALC1KO PARP1KO exp5 exp5 ALC1KO PARP1KO veliparib_3000nM 881.0 3.477121 938.125 0.9391073 0.9805229 0.9577617

Plot Data

library(ggplot2)

# raw data
ggplot(dataset, aes(x=Veliparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=FALSE, colour="#666666") +
        geom_point(aes(colour=Treatment, shape=Experiment), size=2) +        
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") +
        scale_shape_manual(values=14:19) +
        scale_color_manual(values=c("#999999","#0072B2","#CC79A7","#009E73"))

# Counts Linear
ggplot(dataset, aes(x=Veliparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)")

# NormCounts Linear
ggplot(dataset, aes(x=Veliparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)")

# NormCounts2 Linear
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)")

# Counts Quadratic
ggplot(dataset, aes(x=Veliparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") 

# NormCounts Quadratic
ggplot(dataset, aes(x=Veliparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") 

# NormCounts2 Quadratic
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") 

# Counts Cubic
ggplot(dataset, aes(x=Veliparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") 

# NormCounts Cubic
ggplot(dataset, aes(x=Veliparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") 

# NormCounts2 Cubic
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") 

library(Cairo)

cairo_pdf("FigureS1F_v1.pdf", width = 14, height = 4, family = "Arial")

ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
        facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c('#000000','#800000','#000080','#808080'))

dev.off()
## quartz_off_screen 
##                 2
cairo_pdf("FigureS1F_v2.pdf", width = 6, height = 4, family = "Arial")

ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
        #facet_grid(. ~ genotype) +
        xlab(label = "Veliparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c('#000000','#800000','#000080','#808080'))

dev.off()
## quartz_off_screen 
##                 2

Models

library(MASS)
library(DHARMa)
library(lme4)
library(lmerTest)
library(bbmle)

Linear formula

fit1 <- lm(Counts ~ Experiment + Veliparib*genotype, data = dataset)
print(summary(fit1))
## 
## Call:
## lm(formula = Counts ~ Experiment + Veliparib * genotype, data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -335.54  -93.08  -15.64   86.14  321.72 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       674.9382    68.5460   9.846 1.02e-14 ***
## Experimentexp2                    136.2500    53.5830   2.543  0.01328 *  
## Experimentexp3                    138.2188    53.5830   2.580  0.01206 *  
## Experimentexp4                    182.7812    53.5830   3.411  0.00109 ** 
## Experimentexp5                     97.9063    53.5830   1.827  0.07206 .  
## Veliparib                           4.6320    26.3783   0.176  0.86113    
## genotypePARP1KO                    53.3452    84.2627   0.633  0.52880    
## genotypeALC1KO                    165.5357    84.2627   1.965  0.05356 .  
## genotypeALC1KO PARP1KO             -7.0232    84.2627  -0.083  0.93382    
## Veliparib:genotypePARP1KO          -0.5895    37.3045  -0.016  0.98744    
## Veliparib:genotypeALC1KO         -124.9088    37.3045  -3.348  0.00133 ** 
## Veliparib:genotypeALC1KO PARP1KO   -5.7200    37.3045  -0.153  0.87859    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 151.6 on 68 degrees of freedom
## Multiple R-squared:  0.3726, Adjusted R-squared:  0.2711 
## F-statistic: 3.671 on 11 and 68 DF,  p-value: 0.0004078
cat("AIC: ", AIC(fit1))
## AIC:  1043.381
simres <- simulateResiduals(fittedModel = fit1)
plot(simres)

fit2 <- lm(NormCounts ~ Veliparib*genotype, data = dataset)
print(summary(fit2))
## 
## Call:
## lm(formula = NormCounts ~ Veliparib * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.34654 -0.03013  0.00492  0.04262  0.24803 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       0.986718   0.044077  22.386  < 2e-16 ***
## Veliparib                         0.007149   0.019514   0.366    0.715    
## genotypePARP1KO                   0.004637   0.062334   0.074    0.941    
## genotypeALC1KO                    0.377392   0.062334   6.054 5.79e-08 ***
## genotypeALC1KO PARP1KO            0.010382   0.062334   0.167    0.868    
## Veliparib:genotypePARP1KO        -0.002496   0.027596  -0.090    0.928    
## Veliparib:genotypeALC1KO         -0.203135   0.027596  -7.361 2.38e-10 ***
## Veliparib:genotypeALC1KO PARP1KO -0.005588   0.027596  -0.202    0.840    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1121 on 72 degrees of freedom
## Multiple R-squared:  0.584,  Adjusted R-squared:  0.5435 
## F-statistic: 14.44 on 7 and 72 DF,  p-value: 1.398e-11
cat("AIC: ", AIC(fit2))
## AIC:  -113.5156
simres <- simulateResiduals(fittedModel = fit2)
plot(simres)

fit3 <- lm(NormCounts2 ~ Veliparib*genotype, data = dataset)
print(summary(fit3))
## 
## Call:
## lm(formula = NormCounts2 ~ Veliparib * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.272255 -0.030392  0.005018  0.038240  0.194858 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       1.0072075  0.0360818  27.915  < 2e-16 ***
## Veliparib                         0.0072976  0.0159740   0.457    0.649    
## genotypePARP1KO                   0.0008234  0.0510273   0.016    0.987    
## genotypeALC1KO                    0.0644802  0.0510273   1.264    0.210    
## genotypeALC1KO PARP1KO            0.0096985  0.0510273   0.190    0.850    
## Veliparib:genotypePARP1KO        -0.0025660  0.0225906  -0.114    0.910    
## Veliparib:genotypeALC1KO         -0.1612701  0.0225906  -7.139 6.13e-10 ***
## Veliparib:genotypeALC1KO PARP1KO -0.0057055  0.0225906  -0.253    0.801    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.09178 on 72 degrees of freedom
## Multiple R-squared:  0.7256, Adjusted R-squared:  0.6989 
## F-statistic: 27.19 on 7 and 72 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit3))
## AIC:  -145.5396
simres <- simulateResiduals(fittedModel = fit3)
plot(simres)

fit4 <- lmer(Counts ~ Veliparib*genotype + (1|UID), data = dataset)
print(summary(fit4))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ Veliparib * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 896.9
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.60756 -0.32454  0.07546  0.46297  1.88187 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 22911    151.36  
##  Residual              5555     74.53  
## Number of obs: 80, groups:  UID, 20
## 
## Fixed effects:
##                                   Estimate Std. Error        df t value
## (Intercept)                       785.9694    73.7617   19.9717  10.656
## Veliparib                           4.6320    12.9727   56.0000   0.357
## genotypePARP1KO                    53.3452   104.3148   19.9717   0.511
## genotypeALC1KO                    165.5357   104.3148   19.9717   1.587
## genotypeALC1KO PARP1KO             -7.0232   104.3148   19.9717  -0.067
## Veliparib:genotypePARP1KO          -0.5895    18.3461   56.0000  -0.032
## Veliparib:genotypeALC1KO         -124.9088    18.3461   56.0000  -6.808
## Veliparib:genotypeALC1KO PARP1KO   -5.7200    18.3461   56.0000  -0.312
##                                  Pr(>|t|)    
## (Intercept)                      1.09e-09 ***
## Veliparib                           0.722    
## genotypePARP1KO                     0.615    
## genotypeALC1KO                      0.128    
## genotypeALC1KO PARP1KO              0.947    
## Veliparib:genotypePARP1KO           0.974    
## Veliparib:genotypeALC1KO         7.17e-09 ***
## Veliparib:genotypeALC1KO PARP1KO    0.756    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) Velprb gPARP1 gALC1K gALC1P V:PARP V:ALC1
## Veliparib   -0.327                                          
## gntyPARP1KO -0.707  0.231                                   
## gntypALC1KO -0.707  0.231  0.500                            
## gALC1KOPARP -0.707  0.231  0.500  0.500                     
## Vlp:PARP1KO  0.231 -0.707 -0.327 -0.163 -0.163              
## Vlpr:ALC1KO  0.231 -0.707 -0.163 -0.327 -0.163  0.500       
## V:ALC1KOPAR  0.231 -0.707 -0.163 -0.163 -0.327  0.500  0.500
cat("AIC: ", AIC(fit4))
## AIC:  916.9102
simres <- simulateResiduals(fittedModel = fit4)
plot(simres)

Quadratic formula

fit5 <- lm(Counts ~ Experiment + poly(Veliparib, 2)*genotype, data = dataset)
print(summary(fit5))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Veliparib, 2) * genotype, 
##     data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -260.14 -105.17  -19.45   93.83  315.92 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                  683.544     47.766  14.310
## Experimentexp2                               136.250     53.404   2.551
## Experimentexp3                               138.219     53.404   2.588
## Experimentexp4                               182.781     53.404   3.423
## Experimentexp5                                97.906     53.404   1.833
## poly(Veliparib, 2)1                           53.227    302.098   0.176
## poly(Veliparib, 2)2                          -10.235    302.098  -0.034
## genotypePARP1KO                               52.250     47.766   1.094
## genotypeALC1KO                               -66.525     47.766  -1.393
## genotypeALC1KO PARP1KO                       -17.650     47.766  -0.370
## poly(Veliparib, 2)1:genotypePARP1KO           -6.774    427.230  -0.016
## poly(Veliparib, 2)2:genotypePARP1KO          -16.849    427.230  -0.039
## poly(Veliparib, 2)1:genotypeALC1KO         -1435.321    427.230  -3.360
## poly(Veliparib, 2)2:genotypeALC1KO          -621.461    427.230  -1.455
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO   -65.728    427.230  -0.154
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO   -72.786    427.230  -0.170
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## Experimentexp2                              0.01313 *  
## Experimentexp3                              0.01193 *  
## Experimentexp4                              0.00109 ** 
## Experimentexp5                              0.07141 .  
## poly(Veliparib, 2)1                         0.86070    
## poly(Veliparib, 2)2                         0.97308    
## genotypePARP1KO                             0.27811    
## genotypeALC1KO                              0.16852    
## genotypeALC1KO PARP1KO                      0.71297    
## poly(Veliparib, 2)1:genotypePARP1KO         0.98740    
## poly(Veliparib, 2)2:genotypePARP1KO         0.96866    
## poly(Veliparib, 2)1:genotypeALC1KO          0.00132 ** 
## poly(Veliparib, 2)2:genotypeALC1KO          0.15066    
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO  0.87822    
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO  0.86526    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 151 on 64 degrees of freedom
## Multiple R-squared:  0.4134, Adjusted R-squared:  0.2759 
## F-statistic: 3.007 on 15 and 64 DF,  p-value: 0.001112
cat("AIC: ", AIC(fit5))
## AIC:  1045.995
simres <- simulateResiduals(fittedModel = fit5)
plot(simres)

fit6 <- lm(NormCounts ~ poly(Veliparib, 2)*genotype, data = dataset)
print(summary(fit6))
## 
## Call:
## lm(formula = NormCounts ~ poly(Veliparib, 2) * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.25205 -0.03344  0.00313  0.03484  0.31839 
## 
## Coefficients:
##                                              Estimate Std. Error t value
## (Intercept)                                 1.000e+00  2.244e-02  44.556
## poly(Veliparib, 2)1                         8.215e-02  2.007e-01   0.409
## poly(Veliparib, 2)2                         1.066e-02  2.007e-01   0.053
## genotypePARP1KO                             3.252e-16  3.174e-02   0.000
## genotypeALC1KO                              1.694e-16  3.174e-02   0.000
## genotypeALC1KO PARP1KO                      2.603e-16  3.174e-02   0.000
## poly(Veliparib, 2)1:genotypePARP1KO        -2.868e-02  2.839e-01  -0.101
## poly(Veliparib, 2)2:genotypePARP1KO        -4.249e-02  2.839e-01  -0.150
## poly(Veliparib, 2)1:genotypeALC1KO         -2.334e+00  2.839e-01  -8.222
## poly(Veliparib, 2)2:genotypeALC1KO         -9.396e-01  2.839e-01  -3.310
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO -6.421e-02  2.839e-01  -0.226
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO -1.360e-01  2.839e-01  -0.479
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## poly(Veliparib, 2)1                          0.6837    
## poly(Veliparib, 2)2                          0.9578    
## genotypePARP1KO                              1.0000    
## genotypeALC1KO                               1.0000    
## genotypeALC1KO PARP1KO                       1.0000    
## poly(Veliparib, 2)1:genotypePARP1KO          0.9198    
## poly(Veliparib, 2)2:genotypePARP1KO          0.8815    
## poly(Veliparib, 2)1:genotypeALC1KO         8.66e-12 ***
## poly(Veliparib, 2)2:genotypeALC1KO           0.0015 ** 
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO   0.8217    
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO   0.6335    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1004 on 68 degrees of freedom
## Multiple R-squared:  0.6851, Adjusted R-squared:  0.6342 
## F-statistic: 13.45 on 11 and 68 DF,  p-value: 3.537e-13
cat("AIC: ", AIC(fit6))
## AIC:  -127.7917
simres <- simulateResiduals(fittedModel = fit6)
plot(simres)

fit7 <- lm(NormCounts2 ~ poly(Veliparib, 2)*genotype, data = dataset)
print(summary(fit7))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Veliparib, 2) * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.198022 -0.034038  0.003194  0.033536  0.250135 
## 
## Coefficients:
##                                              Estimate Std. Error t value
## (Intercept)                                 1.0207653  0.0185689  54.972
## poly(Veliparib, 2)1                         0.0838566  0.1660849   0.505
## poly(Veliparib, 2)2                         0.0108811  0.1660849   0.066
## genotypePARP1KO                            -0.0039438  0.0262603  -0.150
## genotypeALC1KO                             -0.2351341  0.0262603  -8.954
## genotypeALC1KO PARP1KO                     -0.0009014  0.0262603  -0.034
## poly(Veliparib, 2)1:genotypePARP1KO        -0.0294856  0.2348795  -0.126
## poly(Veliparib, 2)2:genotypePARP1KO        -0.0432484  0.2348795  -0.184
## poly(Veliparib, 2)1:genotypeALC1KO         -1.8531472  0.2348795  -7.890
## poly(Veliparib, 2)2:genotypeALC1KO         -0.7407212  0.2348795  -3.154
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO -0.0655611  0.2348795  -0.279
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO -0.1386869  0.2348795  -0.590
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## poly(Veliparib, 2)1                          0.6153    
## poly(Veliparib, 2)2                          0.9480    
## genotypePARP1KO                              0.8811    
## genotypeALC1KO                             4.09e-13 ***
## genotypeALC1KO PARP1KO                       0.9727    
## poly(Veliparib, 2)1:genotypePARP1KO          0.9005    
## poly(Veliparib, 2)2:genotypePARP1KO          0.8545    
## poly(Veliparib, 2)1:genotypeALC1KO         3.47e-11 ***
## poly(Veliparib, 2)2:genotypeALC1KO           0.0024 ** 
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO   0.7810    
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO   0.5568    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.08304 on 68 degrees of freedom
## Multiple R-squared:  0.7878, Adjusted R-squared:  0.7535 
## F-statistic: 22.95 on 11 and 68 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit7))
## AIC:  -158.1159
simres <- simulateResiduals(fittedModel = fit7)
plot(simres)

fit8 <- lmer(Counts ~ poly(Veliparib, 2)*genotype + (1|UID), data = dataset)
print(summary(fit8))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Veliparib, 2) * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 809.3
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.10426 -0.43912  0.08385  0.44634  2.80603 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 23293    152.62  
##  Residual              4027     63.46  
## Number of obs: 80, groups:  UID, 20
## 
## Fixed effects:
##                                             Estimate Std. Error        df
## (Intercept)                                  794.575     69.713    16.000
## poly(Veliparib, 2)1                           53.227    126.918    52.000
## poly(Veliparib, 2)2                          -10.235    126.918    52.000
## genotypePARP1KO                               52.250     98.589    16.000
## genotypeALC1KO                               -66.525     98.589    16.000
## genotypeALC1KO PARP1KO                       -17.650     98.589    16.000
## poly(Veliparib, 2)1:genotypePARP1KO           -6.774    179.489    52.000
## poly(Veliparib, 2)2:genotypePARP1KO          -16.849    179.489    52.000
## poly(Veliparib, 2)1:genotypeALC1KO         -1435.321    179.489    52.000
## poly(Veliparib, 2)2:genotypeALC1KO          -621.461    179.489    52.000
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO   -65.728    179.489    52.000
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO   -72.786    179.489    52.000
##                                            t value Pr(>|t|)    
## (Intercept)                                 11.398 4.32e-09 ***
## poly(Veliparib, 2)1                          0.419  0.67667    
## poly(Veliparib, 2)2                         -0.081  0.93604    
## genotypePARP1KO                              0.530  0.60341    
## genotypeALC1KO                              -0.675  0.50946    
## genotypeALC1KO PARP1KO                      -0.179  0.86017    
## poly(Veliparib, 2)1:genotypePARP1KO         -0.038  0.97004    
## poly(Veliparib, 2)2:genotypePARP1KO         -0.094  0.92557    
## poly(Veliparib, 2)1:genotypeALC1KO          -7.997 1.29e-10 ***
## poly(Veliparib, 2)2:genotypeALC1KO          -3.462  0.00108 ** 
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO  -0.366  0.71571    
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO  -0.406  0.68676    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) pl(V,2)1 pl(V,2)2 gPARP1 gALC1K gALC1P p(V,2)1:P p(V,2)2:P
## ply(Vlp,2)1  0.000                                                           
## ply(Vlp,2)2  0.000  0.000                                                    
## gntyPARP1KO -0.707  0.000    0.000                                           
## gntypALC1KO -0.707  0.000    0.000    0.500                                  
## gALC1KOPARP -0.707  0.000    0.000    0.500  0.500                           
## p(V,2)1:PAR  0.000 -0.707    0.000    0.000  0.000  0.000                    
## p(V,2)2:PAR  0.000  0.000   -0.707    0.000  0.000  0.000  0.000             
## p(V,2)1:ALC  0.000 -0.707    0.000    0.000  0.000  0.000  0.500     0.000   
## p(V,2)2:ALC  0.000  0.000   -0.707    0.000  0.000  0.000  0.000     0.500   
## p(V,2)1:ALP  0.000 -0.707    0.000    0.000  0.000  0.000  0.500     0.000   
## p(V,2)2:ALP  0.000  0.000   -0.707    0.000  0.000  0.000  0.000     0.500   
##             p(V,2)1:A p(V,2)2:A p(V,2)1P
## ply(Vlp,2)1                             
## ply(Vlp,2)2                             
## gntyPARP1KO                             
## gntypALC1KO                             
## gALC1KOPARP                             
## p(V,2)1:PAR                             
## p(V,2)2:PAR                             
## p(V,2)1:ALC                             
## p(V,2)2:ALC  0.000                      
## p(V,2)1:ALP  0.500     0.000            
## p(V,2)2:ALP  0.000     0.500     0.000
cat("AIC: ", AIC(fit8))
## AIC:  837.2612
simres <- simulateResiduals(fittedModel = fit8)
plot(simres)

Cubic formula

fit9 <- lm(Counts ~ Experiment + poly(Veliparib, 3)*genotype, data = dataset)
print(summary(fit9))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Veliparib, 3) * genotype, 
##     data = dataset)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -255.8 -114.4   -9.1   89.7  320.2 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                  683.544     49.082  13.927
## Experimentexp2                               136.250     54.875   2.483
## Experimentexp3                               138.219     54.875   2.519
## Experimentexp4                               182.781     54.875   3.331
## Experimentexp5                                97.906     54.875   1.784
## poly(Veliparib, 3)1                           53.227    310.423   0.171
## poly(Veliparib, 3)2                          -10.235    310.423  -0.033
## poly(Veliparib, 3)3                          186.106    310.423   0.600
## genotypePARP1KO                               52.250     49.082   1.065
## genotypeALC1KO                               -66.525     49.082  -1.355
## genotypeALC1KO PARP1KO                       -17.650     49.082  -0.360
## poly(Veliparib, 3)1:genotypePARP1KO           -6.774    439.004  -0.015
## poly(Veliparib, 3)2:genotypePARP1KO          -16.849    439.004  -0.038
## poly(Veliparib, 3)3:genotypePARP1KO          -64.937    439.004  -0.148
## poly(Veliparib, 3)1:genotypeALC1KO         -1435.321    439.004  -3.269
## poly(Veliparib, 3)2:genotypeALC1KO          -621.461    439.004  -1.416
## poly(Veliparib, 3)3:genotypeALC1KO          -259.748    439.004  -0.592
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO   -65.728    439.004  -0.150
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO   -72.786    439.004  -0.166
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO  -120.120    439.004  -0.274
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## Experimentexp2                              0.01585 *  
## Experimentexp3                              0.01446 *  
## Experimentexp4                              0.00149 ** 
## Experimentexp5                              0.07946 .  
## poly(Veliparib, 3)1                         0.86444    
## poly(Veliparib, 3)2                         0.97381    
## poly(Veliparib, 3)3                         0.55108    
## genotypePARP1KO                             0.29135    
## genotypeALC1KO                              0.18038    
## genotypeALC1KO PARP1KO                      0.72041    
## poly(Veliparib, 3)1:genotypePARP1KO         0.98774    
## poly(Veliparib, 3)2:genotypePARP1KO         0.96951    
## poly(Veliparib, 3)3:genotypePARP1KO         0.88290    
## poly(Veliparib, 3)1:genotypeALC1KO          0.00179 ** 
## poly(Veliparib, 3)2:genotypeALC1KO          0.16206    
## poly(Veliparib, 3)3:genotypeALC1KO          0.55629    
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO  0.88149    
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO  0.86887    
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO  0.78532    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 155.2 on 60 degrees of freedom
## Multiple R-squared:  0.4194, Adjusted R-squared:  0.2355 
## F-statistic: 2.281 on 19 and 60 DF,  p-value: 0.008142
cat("AIC: ", AIC(fit9))
## AIC:  1053.182
simres <- simulateResiduals(fittedModel = fit9)
plot(simres)

fit10 <- lm(NormCounts ~ poly(Veliparib, 3)*genotype, data = dataset)
print(summary(fit10))
## 
## Call:
## lm(formula = NormCounts ~ poly(Veliparib, 3) * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.255295 -0.028267  0.000888  0.036645  0.315147 
## 
## Coefficients:
##                                              Estimate Std. Error t value
## (Intercept)                                 1.000e+00  2.266e-02  44.133
## poly(Veliparib, 3)1                         8.215e-02  2.027e-01   0.405
## poly(Veliparib, 3)2                         1.066e-02  2.027e-01   0.053
## poly(Veliparib, 3)3                         2.557e-01  2.027e-01   1.262
## genotypePARP1KO                             2.914e-16  3.204e-02   0.000
## genotypeALC1KO                              2.365e-16  3.204e-02   0.000
## genotypeALC1KO PARP1KO                      2.554e-16  3.204e-02   0.000
## poly(Veliparib, 3)1:genotypePARP1KO        -2.868e-02  2.866e-01  -0.100
## poly(Veliparib, 3)2:genotypePARP1KO        -4.249e-02  2.866e-01  -0.148
## poly(Veliparib, 3)3:genotypePARP1KO        -1.094e-01  2.866e-01  -0.382
## poly(Veliparib, 3)1:genotypeALC1KO         -2.334e+00  2.866e-01  -8.144
## poly(Veliparib, 3)2:genotypeALC1KO         -9.396e-01  2.866e-01  -3.278
## poly(Veliparib, 3)3:genotypeALC1KO         -3.574e-01  2.866e-01  -1.247
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO -6.421e-02  2.866e-01  -0.224
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO -1.360e-01  2.866e-01  -0.474
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO -1.354e-01  2.866e-01  -0.473
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## poly(Veliparib, 3)1                         0.68657    
## poly(Veliparib, 3)2                         0.95822    
## poly(Veliparib, 3)3                         0.21165    
## genotypePARP1KO                             1.00000    
## genotypeALC1KO                              1.00000    
## genotypeALC1KO PARP1KO                      1.00000    
## poly(Veliparib, 3)1:genotypePARP1KO         0.92061    
## poly(Veliparib, 3)2:genotypePARP1KO         0.88261    
## poly(Veliparib, 3)3:genotypePARP1KO         0.70396    
## poly(Veliparib, 3)1:genotypeALC1KO          1.8e-11 ***
## poly(Veliparib, 3)2:genotypeALC1KO          0.00169 ** 
## poly(Veliparib, 3)3:genotypeALC1KO          0.21693    
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO  0.82344    
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO  0.63681    
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO  0.63813    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1013 on 64 degrees of freedom
## Multiple R-squared:  0.6979, Adjusted R-squared:  0.6271 
## F-statistic: 9.858 on 15 and 64 DF,  p-value: 1.611e-11
cat("AIC: ", AIC(fit10))
## AIC:  -123.1178
simres <- simulateResiduals(fittedModel = fit10)
plot(simres)

fit11 <- lm(NormCounts2 ~ poly(Veliparib, 3)*genotype, data = dataset)
print(summary(fit11))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Veliparib, 3) * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.200568 -0.028806  0.000905  0.035779  0.247589 
## 
## Coefficients:
##                                              Estimate Std. Error t value
## (Intercept)                                 1.0207653  0.0185618  54.993
## poly(Veliparib, 3)1                         0.0838566  0.1660217   0.505
## poly(Veliparib, 3)2                         0.0108811  0.1660217   0.066
## poly(Veliparib, 3)3                         0.2610037  0.1660217   1.572
## genotypePARP1KO                            -0.0039438  0.0262503  -0.150
## genotypeALC1KO                             -0.2351341  0.0262503  -8.957
## genotypeALC1KO PARP1KO                     -0.0009014  0.0262503  -0.034
## poly(Veliparib, 3)1:genotypePARP1KO        -0.0294856  0.2347902  -0.126
## poly(Veliparib, 3)2:genotypePARP1KO        -0.0432484  0.2347902  -0.184
## poly(Veliparib, 3)3:genotypePARP1KO        -0.1122415  0.2347902  -0.478
## poly(Veliparib, 3)1:genotypeALC1KO         -1.8531472  0.2347902  -7.893
## poly(Veliparib, 3)2:genotypeALC1KO         -0.7407212  0.2347902  -3.155
## poly(Veliparib, 3)3:genotypeALC1KO         -0.3409188  0.2347902  -1.452
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO -0.0655611  0.2347902  -0.279
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO -0.1386869  0.2347902  -0.591
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO -0.1383653  0.2347902  -0.589
##                                            Pr(>|t|)    
## (Intercept)                                 < 2e-16 ***
## poly(Veliparib, 3)1                         0.61523    
## poly(Veliparib, 3)2                         0.94795    
## poly(Veliparib, 3)3                         0.12086    
## genotypePARP1KO                             0.88105    
## genotypeALC1KO                             6.71e-13 ***
## genotypeALC1KO PARP1KO                      0.97272    
## poly(Veliparib, 3)1:genotypePARP1KO         0.90046    
## poly(Veliparib, 3)2:genotypePARP1KO         0.85444    
## poly(Veliparib, 3)3:genotypePARP1KO         0.63424    
## poly(Veliparib, 3)1:genotypeALC1KO         4.98e-11 ***
## poly(Veliparib, 3)2:genotypeALC1KO          0.00245 ** 
## poly(Veliparib, 3)3:genotypeALC1KO          0.15138    
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO  0.78097    
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO  0.55681    
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO  0.55772    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.08301 on 64 degrees of freedom
## Multiple R-squared:  0.8004, Adjusted R-squared:  0.7537 
## F-statistic: 17.11 on 15 and 64 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit11))
## AIC:  -155.0267
simres <- simulateResiduals(fittedModel = fit11)
plot(simres)

fit12 <- lmer(Counts ~ poly(Veliparib, 3)*genotype + (1|UID), data = dataset)
print(summary(fit12))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Veliparib, 3) * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 759.5
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.13289 -0.38846  0.01958  0.41728  2.75890 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 23286    152.60  
##  Residual              4055     63.68  
## Number of obs: 80, groups:  UID, 20
## 
## Fixed effects:
##                                             Estimate Std. Error        df
## (Intercept)                                  794.575     69.713    16.000
## poly(Veliparib, 3)1                           53.227    127.355    48.000
## poly(Veliparib, 3)2                          -10.235    127.355    48.000
## poly(Veliparib, 3)3                          186.106    127.355    48.000
## genotypePARP1KO                               52.250     98.589    16.000
## genotypeALC1KO                               -66.525     98.589    16.000
## genotypeALC1KO PARP1KO                       -17.650     98.589    16.000
## poly(Veliparib, 3)1:genotypePARP1KO           -6.774    180.107    48.000
## poly(Veliparib, 3)2:genotypePARP1KO          -16.849    180.107    48.000
## poly(Veliparib, 3)3:genotypePARP1KO          -64.937    180.107    48.000
## poly(Veliparib, 3)1:genotypeALC1KO         -1435.321    180.107    48.000
## poly(Veliparib, 3)2:genotypeALC1KO          -621.461    180.107    48.000
## poly(Veliparib, 3)3:genotypeALC1KO          -259.748    180.107    48.000
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO   -65.728    180.107    48.000
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO   -72.786    180.107    48.000
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO  -120.120    180.107    48.000
##                                            t value Pr(>|t|)    
## (Intercept)                                 11.398 4.32e-09 ***
## poly(Veliparib, 3)1                          0.418  0.67786    
## poly(Veliparib, 3)2                         -0.080  0.93628    
## poly(Veliparib, 3)3                          1.461  0.15044    
## genotypePARP1KO                              0.530  0.60341    
## genotypeALC1KO                              -0.675  0.50946    
## genotypeALC1KO PARP1KO                      -0.179  0.86017    
## poly(Veliparib, 3)1:genotypePARP1KO         -0.038  0.97016    
## poly(Veliparib, 3)2:genotypePARP1KO         -0.094  0.92586    
## poly(Veliparib, 3)3:genotypePARP1KO         -0.361  0.72002    
## poly(Veliparib, 3)1:genotypeALC1KO          -7.969 2.45e-10 ***
## poly(Veliparib, 3)2:genotypeALC1KO          -3.451  0.00118 ** 
## poly(Veliparib, 3)3:genotypeALC1KO          -1.442  0.15574    
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO  -0.365  0.71676    
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO  -0.404  0.68792    
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO  -0.667  0.50801    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("AIC: ", AIC(fit12))
## AIC:  795.4916
simres <- simulateResiduals(fittedModel = fit12)
plot(simres)

Compare Results

ICtab(fit1,fit2,fit3,fit4,
      fit5,fit6,fit7,fit8,
      fit9,fit10,fit11,fit12,
      base=T)
##       AIC    dAIC   df
## fit7  -158.1    0.0 13
## fit11 -155.0    3.1 17
## fit3  -145.5   12.6 9 
## fit6  -127.8   30.3 13
## fit10 -123.1   35.0 17
## fit2  -113.5   44.6 9 
## fit12  795.5  953.6 18
## fit8   837.3  995.4 14
## fit4   916.9 1075.0 10
## fit1  1043.4 1201.5 13
## fit5  1046.0 1204.1 17
## fit9  1053.2 1211.3 21

Final Result

fit <- fit7

output <- coef(summary(fit))
output <- output[grep("Veliparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Veliparib1 in WT 0.0838566 0.1660849 0.5049021 0.6152600
Veliparib2 in WT 0.0108811 0.1660849 0.0655156 0.9479557
Veliparib1: WT vs. PARP1KO -0.0294856 0.2348795 -0.1255350 0.9004704
Veliparib2: WT vs. PARP1KO -0.0432484 0.2348795 -0.1841303 0.8544592
Veliparib1: WT vs. ALC1KO -1.8531472 0.2348795 -7.8897775 0.0000000
Veliparib2: WT vs. ALC1KO -0.7407212 0.2348795 -3.1536221 0.0024007
Veliparib1: WT vs. ALC1KO PARP1KO -0.0655611 0.2348795 -0.2791267 0.7809948
Veliparib2: WT vs. ALC1KO PARP1KO -0.1386869 0.2348795 -0.5904595 0.5568399
write.table(output, file = "FigureS1F_Stats_Ref_WT.txt", quote = F, sep = "\t", row.names = T, col.names = NA)
# re-fit with ALC1KO reference
dataset$genotype <- relevel(dataset$genotype, ref = "ALC1KO")
        
fit <- lm(NormCounts2 ~ poly(Veliparib,2)*genotype, data = dataset)


output <- coef(summary(fit))
output <- output[grep("Veliparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Veliparib1 in ALC1KO -1.7692906 0.1660849 -10.652928 0.0000000
Veliparib2 in ALC1KO -0.7298401 0.1660849 -4.394380 0.0000399
Veliparib1: ALC1KO vs. WT 1.8531472 0.2348795 7.889778 0.0000000
Veliparib2: ALC1KO vs. WT 0.7407212 0.2348795 3.153622 0.0024007
Veliparib1: ALC1KO vs. PARP1KO 1.8236616 0.2348795 7.764243 0.0000000
Veliparib2: ALC1KO vs. PARP1KO 0.6974728 0.2348795 2.969492 0.0041179
Veliparib1: ALC1KO vs. ALC1KO PARP1KO 1.7875860 0.2348795 7.610651 0.0000000
Veliparib2: ALC1KO vs. ALC1KO PARP1KO 0.6020344 0.2348795 2.563162 0.0125894
write.table(output, file = "FigureS1F_Stats_Ref_ALC1KO.txt", quote = F, sep = "\t", row.names = T, col.names = NA)

Anova

fita <- lm(NormCounts2 ~ poly(Veliparib, 2)*genotype, data = dataset)
fitb <- lm(NormCounts2 ~ poly(Veliparib, 2)+genotype, data = dataset)

# anova table
anova(fita, fitb)
## Analysis of Variance Table
## 
## Model 1: NormCounts2 ~ poly(Veliparib, 2) * genotype
## Model 2: NormCounts2 ~ poly(Veliparib, 2) + genotype
##   Res.Df     RSS Df Sum of Sq      F    Pr(>F)    
## 1     68 0.46893                                  
## 2     74 1.18078 -6  -0.71185 17.204 5.496e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1